import type { AppRouteRecordRaw } from '@/types/router'

// 使用 Vite 的 import.meta.glob 实现真正的懒加载
const modules = import.meta.glob('../../views/**/*.vue')

/**
 * 测试模块路由
 */
export const testRoutes: AppRouteRecordRaw[] = [
	{
		path: '/test',
		meta: {
			title: '路由.测试',
			isMenu: true
		},
		showSubMenu: true,
		children: [
			{
				path: '/test/demo',
				component: modules['../../views/test/Demo.vue'],
				meta: {
					title: '路由.测试实例',
					isMenu: true
				}
			},
			{
				path: '/test/test',
				component: modules['../../views/test/Test.vue'],
				meta: {
					title: '路由.测试0',
					isMenu: true
				}
			},
			{
				path: '/test/test1',
				component: modules['../../views/test/Test1.vue'],
				meta: {
					title: '路由.测试1',
					isMenu: true
				}
			},
			{
				path: '/test/test2',
				component: modules['../../views/test/Test2.vue'],
				meta: {
					title: '路由.测试2',
					isMenu: true
				}
			},
			{
				path: '/test/testBase64Upload',
				component: modules['../../views/test/TestBase64Upload.vue'],
				meta: {
					title: '路由.测试上传',
					isMenu: true
				}
			},
			{
				path: '/test/testVuex',
				component: modules['../../views/test/TestVuex.vue'],
				meta: {
					title: '路由.测试vuex',
					isMenu: true
				}
			},
			{
				path: '/test/language',
				component: modules['../../views/test/LanguageTest.vue'],
				meta: {
					title: '路由.多语言测试',
					isMenu: true
				}
			},
			{
				path: '/test/currency',
				component: modules['../../views/test/CurrencyTest.vue'],
				meta: {
					title: '路由.币种选择测试',
					isMenu: true
				}
			},
			{
				path: '/test/auto-import',
				component: modules['../../views/test/AutoImportTest.vue'],
				meta: {
					title: '路由.自动导入测试',
					isMenu: true
				}
			},
			{
				path: '/test/type-check',
				component: modules['../../views/test/TypeCheckTest.vue'],
				meta: {
					title: '路由.类型检查测试',
					isMenu: true
				}
			},
			{
				path: '/test/unocss',
				component: modules['../../views/test/UnoCSSTest.vue'],
				meta: {
					title: '路由.UnoCSS测试',
					isMenu: true
				}
			},
			{
				path: '/test/table-language',
				component: modules['../../views/test/TableLanguageTest.vue'],
				meta: {
					title: '路由.表格语言切换测试',
					isMenu: true
				}
			},
			{
				path: '/test/rich-text-editor',
				component: modules['../../views/test/RichTextEditorTest.vue'],
				meta: {
					title: '路由.富文本编辑器测试',
					isMenu: true
				}
			}
		]
	}
]
